package me.caofeng.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import me.caofeng.enums.CheckStatus;

import javax.print.DocFlavor;
import java.io.IOException;

/**
 * Copyright © 2017曹峰. All rights reserved.
 *
 * @Prject: mall
 * @Package: me.caofeng.serializer
 * @Description:
 * @Author: 曹峰 blog.caofeng.me
 * @Date: 2017-06-26 17:49
 * @Version: V1.0
 */
public class CheckStatusSerializer extends JsonSerializer<CheckStatus> {

    @Override
    public void serialize(CheckStatus value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
        gen.writeBoolean(value.isStatus());
    }
}
